home *** CD-ROM | disk | FTP | other *** search
- SWAGOLX.EXE (c) 1993 GDSOFT ALL RIGHTS RESERVED 00002 1 05-26-9406:20ALL MAYNARD PHILBROOK Screen Blanker-InterruptsSWAG9405 28 «F {πVia SLMAIL v3.5C (#2081)π -=> Quoting Joe Irwin to Maynard Philbrook <=-π JI> either inline code or assembler that could be compiled to obj andπ JI> linked that would read the keyboard and if a key is not pressed in aπ JI> variable or set amount of time jump to a procedure. I'm talking aboutπ JI> a tsr routine and what I have in mind is a tsr dos screensaver. I'veπ JI> been working on this forever and am just not good enough with interuptsπ JI> or assembler to do it. I'm using tp 5.5 which does not support the asmπ JI> command but inline(/) only. Any help would be appreciated.π JI> Joe Irwinπ JI> -!- FMail 0.92π JI> ! Origin: MK Tech BBS-MK Software (513)237-7737 Dayton,OH HST/v32π JI> (1:110/290)π}ππUses dos,crt;ππConst Set_Time :Word = 100; { 0 for no blanking }πVarπTemp,Temp1 : Integer;πC :Char;πOld_Screen :Array[0..1999] of Word;πOLD_INT9, OLD_INT8 :Pointer;πNO_Pressed :Word; { Counter }πSaved_Flag :Word; { varifie Flag }ππ{$F+}πProcedure New_Int9; Assembler; { all of this could be done in TASM }πasm Push ES;π Push DS;π Push BX;π Push AX;π Mov AX, Seg NO_Pressed;π Mov DS, AX;π Mov AX, Set_TIme;π Mov NO_Pressed, AX;π Mov AX, Word [Old_INT9];π Mov Word ptr CS:@Return, AX;π Mov AX, Word [OLD_INT9+2];π Mov Word ptr CS:@Return+2, AX;π Cmp Word Ptr Saved_Flag, 00;π Je @Done;π Mov Word ptr Saved_Flag, 00;π Mov BX, 3999;π Mov AX, $B800;π Mov ES, AX;π@loop:π Mov AL, byte [OLD_SCREEN+BX];π Mov [ES:BX], AL;π Dec BX;π Jnz @Loop;π Mov AL, byte [OLD_SCREEN+BX];π Mov [ES:BX], AL;π@Done:π Pop AX;π Pop BX;π Pop DS;π Pop ES;π Jmp [Dword(@Return)];π@Return:π DD 0;πEnd;ππProcedure New_Int8; Assembler;πASmπ Push ES;π Push DS;π Push BX;π Push AX;π Mov AX, Seg NO_Pressed;π Mov DS, AX;π Mov AX, Word [Old_INT8];π Mov Word ptr @Return, AX;π Mov AX, Word [OLD_INT8+2];π Mov Word ptr @Return+2, AX;π Cmp NO_PRESSED, $00;π Je @Done;π Dec Word Ptr NO_PRESSED;π Jnz @Done;π Mov Saved_Flag, $01;π Mov AX, $B800;π Mov ES, AX;π Mov BX, 3999;π@loop:π Mov AL, byte ptr [ES:BX];π Mov byte ptr OLD_SCREEN+BX, AL;π Mov byte [ES:BX], 0 ;π Dec BX;π Jnz @Loop;π Mov AL, byte ptr [ES:BX];π Mov byte ptr OLD_SCREEN+BX, AL;π@DONE:π Pop AX;π Pop BX;π Pop DS;π Pop ES;π Jmp [Dword(@Return)];π@Return:π DD 0;πEnd;ππBEGINππ Val(Paramstr(1), Temp, Temp1);π If Temp1 = 0 Then Set_Time := temp*18;π NO_PRESSED := Set_Time;π SAVED_FLAG := 00;π GetIntVec($08, OLD_INT8);π GetIntVec($09, OLD_INT9);π SetIntVec($09, @New_Int9);π SetIntVec($08, @New_Int8);πππ While NOT Keypressed DO;π { process your program here }ππSetIntVec($08, old_int8); { to restore it back to normal }πSetIntVec($09, old_int9);πCLrScr;πWriteLn(' Program Writen Bye Maynard A. Phibrook Jr. ');πWriteLn(' 1-203-456-2521 (1993)');ππEND.π 2 05-26-9411:03ALL KEVIN MESS Interrupt Table SWAG9405 40 «F {$R-,S+,I+,D+,T+,F-,V+,B-,N-,L+ }π{$M 4096,0,0 }ππprogram interrupt_table (input,output);ππ{ππ A Program that displays all interrupt vectors.ππ Version 1.00 - 03/10/88 - First releaseππ Kevin Messπ PO Box 35π Boulder City, NV 89005π Compuserve 71121,3360ππ}ππusesπ crt,dos,cursors; { Cursors unit as written by Scott Bussinger }ππconstπ bell = ^G;ππtypeπ string4 = string [4];π keyset = (ESC,PGUP,PGDN,nothing);π pointer_rec = recordπ case integer ofπ 0 : (address : pointer);π 1 : (offset, segment : word)π end; { record }π screentype = recordπ position : array [1..4000] of byte;π x,y : byte;π end; { record }πvarπ vector : array [$00..$FF] of pointer_rec absolute $0000:0000;π colorscreen : screentype absolute $B800:0000;π monoscreen : screentype absolute $B000:0000;π savedscreen : screentype;π intnumber : byte;π finished : Boolean;ππ{*************************************}ππfunction hex (decimal : word) : string4;ππ constπ hexdigit : array [$0..$F] of char = '0123456789ABCDEF';ππ varπ temp : string4;ππ beginπ temp := '';π temp := hexdigit [ hi (decimal) div 16 ] +π hexdigit [ hi (decimal) mod 16 ] +π hexdigit [ lo (decimal) div 16 ] +π hexdigit [ lo (decimal) mod 16 ] ;π hex := tempπ end;ππ{*************************************}ππprocedure frame (x1,y1,x2,y2 : byte);ππ constπ upperleft = #201;π lowerleft = #200;π upperright = #187;π lowerright = #188;π horizontal = #205;π vertical = #186;ππ varπ i : byte;ππ beginπ gotoxy (x1-1,y1-1);π write (upperleft);π gotoxy (x2+1,y1-1);π write (upperright);π gotoxy (x1-1,y2+1);π write (lowerleft);π gotoxy (x2+1,y2+1);π write (lowerright);π for i := x1 to x2 doπ beginπ gotoxy (i,y1-1);π write (horizontal);π gotoxy (i,y2+1);π write (horizontal)π end;π for i := y1 to y2 doπ beginπ gotoxy (x1-1,i);π write (vertical);π gotoxy (x2+1,i);π write (vertical)π end;π end; { frame }πππ{*************************************}ππprocedure display_screen (first_intnumber : byte);ππ varπ x,y,π last_intnumber,π intnumber : byte;ππ begin { display_screen }π last_intnumber := first_intnumber + $3F;π x := 5;π y := 1;π for intnumber := first_intnumber to last_intnumber doπ with vector [intnumber] doπ beginπ gotoxy (x,y);π write (copy(hex(intnumber),3,2),hex(segment):6,':',hex(offset));π inc (y);π if ((intnumber + 1) mod $10) = 0 thenπ if intnumber <> last_intnumber thenπ beginπ inc (x,19);π y := 1π endπ end; { with }π end; { display_screen }πππ{*************************************}πππfunction endkey : keyset;ππ varπ anykey : char;π exit : keyset;ππ beginπ repeatπ exit := nothing;π anykey := readkey;π if anykey = #0 thenπ anykey := readkey;π case anykey ofπ #27 : exit := ESC;π #73 : exit := PGUP;π #81 : exit := PGDN;π else write (bell);π end; { case }π until exit in [ESC,PGUP,PGDN];π endkey := exitπ end;ππ{*************************************}ππprocedure int_table (intnumber : byte);ππ begin { int_table }π if monodisplay thenπ savedscreen := monoscreenπ elseπ beginπ savedscreen := colorscreen;π textcolor (white);π textbackground (blue)π end;π savedscreen.x := wherex;π savedscreen.y := wherey;π makecursor (nocursor);π frame (2,2,79,19);π window (2,2,79,19);π clrscr;π gotoxy (12,18);π write ('PgUp - Previous Page, PgDn - Next Page, Esc to Exit');π finished := FALSE;π repeatπ display_screen (intnumber);π case endkey ofπ PGUP : if intnumber >= $40 thenπ dec (intnumber,$40)π elseπ intnumber := $C0;π PGDN : if intnumber <= $80 thenπ inc (intnumber,$40)π elseπ intnumber := $00;π ESC : finished := TRUEπ end { case }π until finished;π window (1,1,80,25);π if monodisplay thenπ monoscreen := savedscreenπ elseπ colorscreen := savedscreen;π gotoxy (savedscreen.x,savedscreen.y);π makecursor (restorecursor)π end; { int_table }ππ{*************************************}πππbegin { main }π intnumber := $00;π int_table (intnumber)πend. { main }π